package extendsMethod

import "fmt"

type Student struct {
	name string
	age  int
}

type PrimarySchool struct {
	Student
	StudentType string
}

func (p *PrimarySchool) GetStudent() Student {
	return p.Student
}
func (p *PrimarySchool) SetStudentType(StudentType string) {
	p.StudentType = StudentType
}
func (p *PrimarySchool) GetStudentType() string {
	return p.StudentType
}
func (p *Student) SetName(name string) {
	p.name = name
}
func (p *Student) GetName() string {
	return p.name
}
func (p *Student) SetAge(age int) {
	p.age = age
}
func (p *Student) GetAge() int {
	return p.age
}

func (p *PrimarySchool) String() string {
	pStr := fmt.Sprintf("name=%v,age=%v,StudentType=%v\n", p.name, p.age, p.StudentType)
	return pStr
}
func (p *Student) String() string {
	pStr := fmt.Sprintf("name=%v,age=%v\n", p.name, p.age)
	return pStr
}
func NewPrimarySchool() *PrimarySchool {
	return &PrimarySchool{}
}
